// @是webpack中配置好的一个别名  代表src的路径
import Vue from 'vue'
import App from '@/App'
import router from '@/router';
import store from '@/store'
import "swiper/css/swiper.min.css"; //  引入swiper的 css
import '@/mock/mockServer'

import * as API from '@/api'

import { Button ,MessageBox,Message } from 'element-ui';
Vue.use(Button)



Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
// Vue.prototype.$confirm = MessageBox.confirm;
// Vue.prototype.$prompt = MessageBox.prompt;

Vue.prototype.$message = Message;//用来做提示消息替代我们的alert
// import '@/api'

// import {reqCategoryList} from '@/api'
// reqCategoryList()


//  全局注册组件
import TypeNav from '@/components/TypeNav';
import SwiperLoop from '@/components/SwiperLoop'
import Pagination from '@/components/Pagination'
// Vue.component('TypeNav',TypeNav)

Vue.component(TypeNav.name,TypeNav)
Vue.component('SwiperLoop',SwiperLoop)
Vue.component('Pagination',Pagination)

Vue.config.productionTip = false

new Vue({
  // 第一步 : 安装总线
  beforeCreate(){
    Vue.prototype.$bus = this
    Vue.prototype.$API = API
  },
  render: h => h(App),
  router,  // 每个组件内部都可以通过this.$router
  store   //每个组件内部都可以通过this.$store 获取到store
}).$mount('#app')
